var _n74;
var cc__extends = __extends;
var cc__decorate = __decorate;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var cc__decorator = cc._decorator;
var ccp_ccclass = cc__decorator.ccclass;
var ccp_property = cc__decorator.property;
var def_rankingObj = function (t) {
  function _ctor() {
    var instance = null !== t && t.apply(this, arguments) || this;  // 确保使用正确的上下文

    // 初始化属性
    instance.label1 = null;
    instance.label2 = null;
    instance.label3 = null;
    instance.bg2 = null;
    instance.itemID = -1;      // 默认值
    instance.label4 = null;

    return instance;  // 返回实例
  }
  cc__extends(_ctor, t);
  _ctor.prototype.updateContent1 = function (t, e, o) {
    let currentContext = this; // 将 `this` 赋值给更具语义的变量名
    this.itemID = e; // 为 `e` 使用更具描述性的命名
    const cityRankInfo = t.cityRankInfo[e]; // 更改 `t` 的命名，使其更加具备语义

    if (cityRankInfo) {
      this.node.active = true;
      this.label1.string = `${e + 1}`; // 使用模板字符串
      this.label2.string = `${cityRankInfo.cityName}`; // 使用模板字符串
      this.label3.string = `${cityRankInfo.grade}位`; // 使用模板字符串
      this.label4.string = `${cityRankInfo.university}位`; // 使用模板字符串

      // 遍历子节点并设置激活状态
      this.node.getChildByName("spDi").children.forEach((childNode, index) => {
        childNode.active = index === currentContext.itemID; // 使用更好的命名和严格相等
      });

      // 设置背景活跃状态和颜色
      this.bg2.active = e % 2 === 1; // 使用严格相等
      this.label1.node.color = e < 3 ? cc.color().fromHEX("#ffffff") : cc.color().fromHEX("#000000");

      // 调用展示更新函数
      this.renewShow(o); // 使用更具描述性的命名
    } else {
      this.node.active = false; // 设置节点不活跃
    }
  };
  _ctor.prototype.renewShow = function (t) {
    this.node.getChildByName("nums").children.forEach(function (e, o) {
      e.active = o == t - 1;
    });
  };
  cc__decorate([ccp_property(cc.Label)], _ctor.prototype, "label1", undefined);
  cc__decorate([ccp_property(cc.Label)], _ctor.prototype, "label2", undefined);
  cc__decorate([ccp_property(cc.Label)], _ctor.prototype, "label3", undefined);
  cc__decorate([ccp_property(cc.Node)], _ctor.prototype, "bg2", undefined);
  cc__decorate([ccp_property({
    type: cc.Label
  })], _ctor.prototype, "label4", undefined);
  return cc__decorate([ccp_ccclass], _ctor);
}(cc.Component);
exports.default = def_rankingObj;